// components/cus-tabbar.js
Component({
	data: {
    isIphoneX: app.globalData.systemInfo.model.search('iPhone X') != -1 ? true : false,
    tabbar: [{
        "pagePath": "pages/index/index",
				"text": "工作",
				"iconPath": "static/images/work.png",
				"selectedIconPath": "static/images/work_active.png"
    },
    {
        "pagePath": "/pages/common/common",
        "isSpecial": true,
    },
    {
			"pagePath": "pages/index/index",
			"text": "工作",
			"iconPath": "static/images/work.png",
			"selectedIconPath": "static/images/work_active.png"
	 },
	 {
		"pagePath": "pages/index/index",
		"text": "工作",
		"iconPath": "static/images/work.png",
		"selectedIconPath": "static/images/work_active.png"
   },
   {
	  "pagePath": "pages/index/index",
	  "text": "工作",
	  "iconPath": "static/images/work.png",
	  "selectedIconPath": "static/images/work_active.png"
   },
],
},
setTabbar(){
	let currentPages = getCurrentPages();
	let pagePath = currentPages[currentPages.length - 1].route;
	this.data.tabbar.forEach(item => {
			item.selected = false;
			if(item.pagePath.indexOf(pagePath) > -1){
					item.selected = true;
			}
	})
	this.setData({
			tabbar: this.data.tabbar
	});
}
})
